<?php
function GetGlobalConnectionOptions()
{
	return array(
		'server' => 'localhost',
		'username' => 'tom',
		'password' => 'hines',
		'database' => 'IPT2012tomandjack'
		);
};

//Connect
$condet = GetGlobalConnectionOptions();
$con = mysql_connect($condet["server"],$condet["username"],$condet["password"]);
if (!$con)
{
	die("Could not connect: " . mysql_error());
}

//Select DB
mysql_select_db($condet["database"], $con);

//Code
//Update all stock levels
$qry = "UPDATE tblitems
SET stock=targetstock;";
mysql_query($qry);

//Disconnect
mysql_close($con);

//Redirect back home
header("Location: http://iptsites.justbunto.com/tom/");
?>

<html>
<body>
html
</body>
</html>
